<%@ page contentType="text/html; charset=utf-8" language="java"  %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="thx" uri="/thx-tags"%>
<style>
.table-bordered tr{
	text-align: left;
}
</style>
<section class="content-header">
	<h1>
		资源管理<small>系统管理</small>
	</h1>
	<ol class="breadcrumb">
		<li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
		<li><a href="#">系统管理</a></li>
		<li class="active">资源管理</li>
	</ol>
</section>

<section class="content">
	<div class="row">
		<div class="col-md-12">
			<div class="box">
				<div class="box-body no-padding">
            		<div class="row">
               			 <div class="col-sm-12">
							<table class="table table-bordered tree">
							<tr>
			                	<th  width="35%">资源名称</th>
			                	<th  width="25%">资源编码</th>
			                    <th width="15%">小图标</th>
			                	<th width="10%">序号</th>
			                    <th width="15%">操作</th>
			                </tr>
							<c:if test="${empty list}">
			                <tr>
			                	<td colspan="7">
			                		暂无数据！
			                	</td>
			                </tr>
			                </c:if>
			                <c:forEach items='${list }' var="r">
			                <tr class="${r.gridClass }">
			                	<td>${r.name}</td>
			                	<td>${r.code}</td>
		           				<td>${r.smallIcon}</td>
								<td>${r.orderSeq}</td>
			                    <td>
									<button type="button"
											title="资源详情"
											data-toggle="tooltip"
											data-placement="bottom"
											open-url="sys/resource!view.action?id=${r.resourceId}"
											class="btn btn-default btn-sm btn-open-form">
											<i class="fa fa-sticky-note-o"></i>
									</button>
									<thx:privileged id="sys/resource!input.action" idName="url">
										<button type="button"
												title="修改资源"
												data-toggle="tooltip"
												data-placement="bottom"
												open-url="sys/resource!input.action?id=${r.resourceId}"
												class="btn btn-default btn-sm btn-open-form">
												<i class="fa fa-edit"></i>
										</button>
									</thx:privileged>
			                        <thx:privileged id="sys_res_del">
										<button type="button"
												title="删除资源"
												data-toggle="tooltip"
												data-placement="bottom"
												do-url="sys/resource!delete.action?id=${r.resourceId}"
												load-url="sys/resource!list.action"
												confirm-msg="确定要删除吗？"
												class="btn btn-default btn-sm btn-open-confirm-win">
												<i class="fa fa-trash"></i>
										</button>
									</thx:privileged>
								</td>
			                </tr>
			                </c:forEach>
					</table>
					</div></div>
				</div>
				<div class="box-footer">
					 <!--底部操作区-->
					<div class="handlePanel">
					   <thx:privileged id="sys/resource!input.action" idName="url">
						   	 <a title="新增资源" class="a-btn btn-open-form"
						   	 	open-url="sys/resource!input.action">
						   	 	<span class="fa fa-plus"></span>
								<span class="text">新增</span>
							 </a>
					   </thx:privileged>
					</div>
				</div>
			</div>
		</div>
	</div>
</section>
<script>
	$(function() {
		list.init();
		$(".tree").treegrid();
	});
</script>
